package org.example.api;

import org.example.common.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name ="demo-server")
@Component
public interface UserApi {
    @RequestMapping("/getUserByName")
    User getUserByName(@RequestParam("username") String username);

    @RequestMapping("/addUser")
    int addUser(@RequestBody User user);
}
